#!/usr/bin/env bash

set -e

if [ ! -f install ]; then
    echo 'install must be run within its container folder' 1>&2
    exit 1
fi

CURDIR=`pwd`
OLDGOPATH="$GOPATH"
export GOPATH="$CURDIR:$CURDIR/thirdparty"

if [ ! -d log ]; then
    mkdir log
fi

gofmt -w src

go install btcrobot

export GOPATH="$OLDGOPATH"
export PATH="$OLDPATH"

echo 'finished'
